/*******************************************************************************
 * Copyright (c) 2010, 2015 git@git.oschina.net:kaiwill/springstage.git
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.qinyeit.serviceapp.repository.system;

import com.qinyeit.serviceapp.entity.system.ManagementAccount;
import com.qinyetech.springstage.core.repository.BaseRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

/** 
 * ClassName: ManagementAccountRepository <br/>
 * Function: 账号仓库基础类 <br/>
 * date: 2015年8月22日 上午10:45:45 <br/> 
 * 
 * @author wuqing 
 * @version  
 * @since JDK 1.7 
 */
public interface ManagementAccountRepository extends BaseRepository<ManagementAccount,Long> {
	public ManagementAccount findFirstByAccount(String account);

	@Transactional
	@Modifying
	@Query(value = "DELETE from management_account_roles where management_account_id = ?1",nativeQuery = true)
	void deleteRolesByAccountId(Long id);
}
